#ifndef QLSearchWIDGET_H
#define QLSearchWIDGET_H

#include "qmybaseformwidget.h"
#include "ui_qLSearchwidget.h"
#include <QStandardItemModel>
#include <QHeaderView>
#include "chelperclass.h"
#include "qstablewidgetdelegate.h"
#include "qcomboboxitemdelegate.h"

class QLSearchWidget : public QMyBaseFormWidget
{
	Q_OBJECT

public:
	QLSearchWidget(QWidget *parent = 0);
	~QLSearchWidget();
    virtual void pressEscape();
    void lista(const QString& nameSearch);
    void lista_detail(const QString& nameSearch);
    void setInitText(QString text);
    virtual void pressReturn();
    void setFocusSearchField();
	QStandardItemModel *model;
    QStandardItemModel *model2;

private:
	Ui::QLSearchWidgetClass ui;
    QString m_selectedText_name;
    CHelperClass *m_chc;
    QHeaderView * header;
    QHeaderView * header2;
    QModelIndex index;
    bool editorOpen;

    QString m_selectedText;
    QString m_selectedTextName;
    QString m_selectedTextNameSaldo;
    QComboBoxItemDelegate pItemDelegate;
private slots:
    void on_tableView_clicked(const QModelIndex &);
    void on_lineEdit_textChanged(const QString &);
    void on_lineEdit_2_textChanged(const QString &);
    void selectionChanged(QModelIndex modelX, QModelIndex modelY );
    void selectionChangedDetail(QModelIndex modelX, QModelIndex modelY );
    void slotDoubleMC(const QModelIndex &);
    
    void radioButtonClicked();
    void openEditor();
    void closeEditor();

signals:
    void closeW();
    void sLSearchToDokument(QString& text, QString& textName, QString& textNameSaldo, QString& mag_tip );	
    void editCell();
    void closeCell();
};

#endif // QLSearchWIDGET_H
